package com.ct.gd.passport.domain;

import java.util.ArrayList;
import java.util.List;

import com.ct.gd.passport.common.connect.CtServer;
import com.ct.gd.passport.common.constants.Config;
import com.ct.gd.passport.common.constants.Protocol;
import com.fuckhtc.gson.Gson;
import com.fuckhtc.gson.annotations.SerializedName;
import com.up91.common.android.connect.Params;

public class ExhibitionInfoDetail {
	@SerializedName("id")
	private int				id;

	@SerializedName("title")
	private String			title;

	@SerializedName("content")
	private String			content;

	@SerializedName("beginTime")
	private String			beginTime;

	@SerializedName("endTime")
	private String			endTime;

	@SerializedName("pic")
	private List<String>	pics;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public List<String> getPics() {
		return pics;
	}

	public void setPics(List<String> pics) {
		this.pics = pics;
	}

	public String getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(String beginTime) {
		this.beginTime = beginTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public static ExhibitionInfoDetail load(int id) {

		Params params = new Params();
		params.put(Protocol.Fields.DISCOUNT_ID, id);
		
		if (Config.ON_LINE) {
			String json = CtServer.getServer().doGet(Protocol.Commands.EXHIBITION_DETAIL, params);
			return new Gson().fromJson(json, ExhibitionInfoDetail.class);
		}
		
		ExhibitionInfoDetail info = new ExhibitionInfoDetail();
		info.setId(1);
		info.setTitle("肯德基优惠");
		info.setContent("肯德基套餐优惠");
		List<String> pics = new ArrayList<String>();
		pics.add("http://kfc.img.xixik.net/c/kfc/xixik_kfc_8ac174b9da286550.jpg");
		info.setPics(pics);
		return info;
	}

}
